<?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet version="1.0" xmlns:ctl="http://arche.auction.co.kr/WebControl/XmlControl" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:s="http://schema.auction.co.kr/Arche.Stores.xsd" xmlns:ms="urn:schemas-microsoft-com:xslt"
	xmlns:ARCHE="http://www.auction.co.kr/xsltFunc" exclude-result-prefixes="ctl s">
	<!--<xsl:output indent="yes" method="html" encoding="ks_c_5601-1987" />-->
	<xsl:output indent="yes" method="html" encoding="utf-8" />
	<!--
  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  Start TEMPLATE
  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  -->
	<xsl:template match="/">
		<xmp>
		<xsl:apply-templates select="ctl:Params" />
	</xmp>
		<xsl:apply-templates select="ctl:ControlData/ctl:Params" />
	</xsl:template>
	<!--
  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  Params TEMPLATE
  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  -->
	<xsl:template match="ctl:Params">
		<!--<base href="http://www.auction.co.kr" />-->
		<table width="620" border="0" cellspacing="0" cellpadding="5">
			<xsl:attribute name="currentYear">
				<xsl:value-of select="CurrentYear" />
			</xsl:attribute>
			<xsl:attribute name="width">
				<xsl:value-of select="Width" />
			</xsl:attribute>
			<xsl:attribute name="style">behavior:url('<xsl:value-of select="BehaviorUrl" />')</xsl:attribute>
			<xsl:attribute name="fromDate">
				<xsl:value-of select="concat(FromDate/Year,'-',FromDate/Month,'-',FromDate/Day)" />
			</xsl:attribute>
			<xsl:attribute name="toDate">
				<xsl:value-of select="concat(ToDate/Year,'-',ToDate/Month,'-',ToDate/Day)" />
			</xsl:attribute>
			<xsl:attribute name="baseSide">
				<xsl:value-of select="BaseSide" />
			</xsl:attribute>
			<tr>
				<td align="right">
					<xsl:attribute name="width">
						<xsl:value-of select="LeftTdWidth" />
					</xsl:attribute>
					<strong>
						<font color="#007540">
							<img src="image/cat_bluebullet.gif" width="4" height="10" hspace="4" align="absmiddle" />
							<xsl:if test="TitleVisible='True'">
								<font color="#666666">
									<xsl:value-of select="Title" />
								</font>
							</xsl:if>
						</font>
					</strong>
				</td>
				<td>
					<xsl:attribute name="width">
						<xsl:value-of select="RightTdWidth" />
					</xsl:attribute>
					<input type="button" value="오늘" name="btnDate1" />
					<xsl:call-template name="nbsp" />
					<xsl:call-template name="nbsp" />
					<input type="button" value="1주" name="btnDate2" />
					<xsl:call-template name="nbsp" />
					<xsl:call-template name="nbsp" />
					<input type="button" value="2주" name="btnDate3" />
					<xsl:call-template name="nbsp" />
					<xsl:call-template name="nbsp" />
					<input type="button" value="1개월" name="btnDate4" />
				</td>
			</tr>
			<tr>
				<td>
					<xsl:call-template name="nbsp" />
				</td>
				<td>                    
					<select name="selYear1">
						<xsl:call-template name="GenerateOptionTag">
							<xsl:with-param name="CurrentIndex" select="CurrentYear - 6" />
							<xsl:with-param name="LastIndex" select="CurrentYear + 1" />
							<xsl:with-param name="SelectedIndex" select="FromDate/Year" />
						</xsl:call-template>
					</select>년
					<select name="selMonth1">
						<xsl:call-template name="GenerateOptionTag">
							<xsl:with-param name="CurrentIndex" select="1" />
							<xsl:with-param name="LastIndex" select="12" />
							<xsl:with-param name="SelectedIndex" select="FromDate/Month" />
						</xsl:call-template>
					</select>월
					<select name="selDay1">
						<xsl:call-template name="GenerateOptionTag">
							<xsl:with-param name="CurrentIndex" select="1" />
							<xsl:with-param name="LastIndex" select="31" />
							<xsl:with-param name="SelectedIndex" select="FromDate/Day" />
						</xsl:call-template>
					</select>일
					<b> ~ </b>
					<select name="selYear2">
						<xsl:call-template name="GenerateOptionTag">
							<xsl:with-param name="CurrentIndex" select="CurrentYear - 6" />
							<xsl:with-param name="LastIndex" select="CurrentYear + 1" />
							<xsl:with-param name="SelectedIndex" select="ToDate/Year" />
						</xsl:call-template>
					</select>년
					<select name="selMonth2">
						<xsl:call-template name="GenerateOptionTag">
							<xsl:with-param name="CurrentIndex" select="1" />
							<xsl:with-param name="LastIndex" select="12" />
							<xsl:with-param name="SelectedIndex" select="ToDate/Month" />
						</xsl:call-template>
					</select>월
					<select name="selDay2">
						<xsl:call-template name="GenerateOptionTag">
							<xsl:with-param name="CurrentIndex" select="1" />
							<xsl:with-param name="LastIndex" select="31" />
							<xsl:with-param name="SelectedIndex" select="ToDate/Day" />
						</xsl:call-template>
					</select>일 
          <xsl:if test="SubmitButtonVisible='True'">
						<input type="image" name="submit" src="image/but_g_refer.gif" width="62" height="23" vspace="4"
							border="0" align="absmiddle" style="cursor:hand;" />
		</xsl:if>
		<xsl:if test="SubmitButtonText!=''">
						<input type="image" name="submit" width="62" border="0" align="absmiddle" class="submit1">
							<xsl:attribute name="value">
								<xsl:value-of select="SubmitButtonText" />
							</xsl:attribute>
						</input>
		</xsl:if>
		
        </td>
			</tr>
		</table>
		<xsl:if test="TipTextVisible='True'">
        	<xsl:value-of disable-output-escaping="yes" select="TipText" />
		</xsl:if>
	</xsl:template>
	<!--
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  GenerateOptionTag TEMPLATE
  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  -->
	<xsl:template name="GenerateOptionTag">
		<xsl:param name="LastIndex" select="1" />
		<xsl:param name="CurrentIndex" select="1" />
		<xsl:param name="SelectedIndex" select="1" />
		<Option>
			<xsl:attribute name="value">
				<xsl:value-of select="$CurrentIndex" />
			</xsl:attribute>
			<xsl:if test="$CurrentIndex = $SelectedIndex">
				<xsl:attribute name="Selected">Selected</xsl:attribute>
			</xsl:if>
			<xsl:value-of select="$CurrentIndex" />
		</Option>
		<xsl:if test="$CurrentIndex &lt; $LastIndex">
			<xsl:call-template name="GenerateOptionTag">
				<xsl:with-param name="CurrentIndex" select="$CurrentIndex + 1" />
				<xsl:with-param name="LastIndex" select="$LastIndex" />
				<xsl:with-param name="SelectedIndex" select="$SelectedIndex" />
			</xsl:call-template>
		</xsl:if>
	</xsl:template>
	<!--
  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  nbsp TEMPLATE
  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  -->
	<xsl:template name="nbsp">
		<xsl:param name="Index" select="1" />
		<xsl:param name="Count" select="1" />
		<xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
		<xsl:if test="$Index &lt; $Count">
			<xsl:call-template name="nbsp">
				<xsl:with-param name="Index" select="$Index + 1" />
				<xsl:with-param name="Count" select="$Count" />
			</xsl:call-template>
		</xsl:if>
	</xsl:template>
</xsl:stylesheet>